<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/scripts/jquery-2.1.4.min.js"></script>
   <script>
       function bb() {
      let pname=$("#pname").val();

      let price=$("#price").val();
      $.post("save.do",{pname:pname,price:price},function (data) {
         if (data.success!=1){
             alert("保存成功")
             window.location.href="tolist.do"
         } else {
             alert("保存失败")
         }

      })
       }
   </script>
</head>
<body>
商品名称：<input type="text" id="pname">
商品价格：<input type="text" id="price">
<input type="submit" value="确定" onclick="bb()">
</body>
</html>